<template>
    <el-tree :data="dataList" :props="defaultProps" node-key="id" @check="checkNode" @node-click="handleNodeClick" />
</template>

<script>
import { ref } from 'vue'
export default {
    props: {
        dataList: Array,
    },
    data() {
        return {
            defaultProps: {
                id: 'id_',
                label: 'name_',
                code: 'code_',
                children: 'children'
            },
        }
    },
    setup(props) {
        return {
            ...props
        }
    },
    methods: {
        handleNodeClick(data) {
            console.log(data)
        },
        checkNode(node) {
            console.log("node====>", node)
        },
        handleNodeClick(data, node, html) {
            this.$emit('checkNode', data)
        }
    },
}
</script>
